package com.aricksm.xuan.activity01;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by xuan on 16/6/17.
 */
public class Order implements Parcelable {

    public int count;
    public String address;
    public boolean isReceived;

    public Order(){

    }

    protected Order(Parcel in) {
        count = in.readInt();
        address = in.readString();
        boolean[] boolArr = new boolean[]{};
        in.readBooleanArray(boolArr);
        isReceived = boolArr[0];
    }

    public static final Creator<Order> CREATOR = new Creator<Order>() {
        @Override
        public Order createFromParcel(Parcel in) {
            return new Order(in);
        }

        @Override
        public Order[] newArray(int size) {
            return new Order[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(count);
        dest.writeString(address);
        dest.writeBooleanArray(new boolean[]{isReceived});
    }
}
